#ifndef BUBBLEFRAME_H
#define BUBBLEFRAME_H

#include "global.h"

#include <QFrame>
#include <QHBoxLayout>

// 气泡框类的基类
class BubbleFrame : public QFrame
{
    Q_OBJECT
public:
    BubbleFrame(ChatRole role, QWidget* parent);

    void setMargin(int margin);
    // 将气泡框内设置文本内容或者图片内容
    void setWidget(QWidget* w);

protected:
    void paintEvent(QPaintEvent* e) override;

private:
    QHBoxLayout* m_pHLayout;
    ChatRole m_role;
    int m_margin;
};

#endif // BUBBLEFRAME_H
